package fw.device.abstraction.layer.api.activator;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;

import fw.device.abstraction.layer.api.BinarySwitch;
import fw.device.abstraction.layer.api.BinarySwitchImpl;

public class Activator implements BundleActivator{

	private ServiceRegistration servideRef;
	public void start(BundleContext bc) throws Exception {
		BinarySwitchImpl bsi = new BinarySwitchImpl();
		servideRef = bc.registerService(BinarySwitch.class.getName(), bsi, null);
	}

	public void stop(BundleContext bc) throws Exception {
		if(servideRef != null) {
			servideRef.unregister();
		}
	}

}
